package com.young.springdemo.service.command;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

//@Component
public class testWindows {

//    @PostConstruct
    public void testWindow() throws  Exception {
        Class<?> aClass = Class.forName("com.young.springdemo.service.command.EditWindowsCommand");
        WindowsCommand windowsCommand = (WindowsCommand)aClass.newInstance();
        MenuItem menuItem = new MenuItem();
        menuItem.setWindowsCommand(windowsCommand);
        menuItem.click();
        System.out.println("==========*********======================");
        Class<?> editCommandC= Class.forName("com.young.springdemo.service.command.EditWindowsCommand");
        Class<?> openCommandC = Class.forName("com.young.springdemo.service.command.OpenWindowCommand");
        Class<?> createCommandC = Class.forName("com.young.springdemo.service.command.CreateWindowsCommand");
        WindowsCommand editCommand = (WindowsCommand)editCommandC.newInstance();
        WindowsCommand openCommand = (WindowsCommand)openCommandC.newInstance();
        WindowsCommand createCommand = (WindowsCommand)createCommandC.newInstance();
        Menu menu = new Menu();
        menu.add(createCommand);
        menu.add(openCommand);
        menu.add(editCommand);
        menu.click();
    }
}
